package net.yunzhanyi.common.core.exception;

/**
 * @author bestct
 * @date 2022/9/17
 * @type 类
 */
public class BaseException extends RuntimeException{

    /**
     * 错误码
     */
    private String code;

    /**
     * 错误码对应的参数
     */
    private Object[] args;

    /**
     * 错误消息
     */
    private String message;

    public BaseException(String code, Object[] args, String message) {
        super(message);
        this.code = code;
        this.args = args;
        this.message = message;
    }


    public BaseException(String code, Object[] args)
    {
        this(code, args, null);
    }

    public BaseException(String message)
    {
        this( null, null, message);
    }


    public String getCode() {
        return code;
    }


    public Object[] getArgs() {
        return args;
    }

    @Override
    public String getMessage() {
        return message;
    }

}
